package com.kdl.webconfig.enums;

/**
 * @Author wcj
 * @Date 2022/07/06
 * @Description 申请状态枚举
 */
public enum NewsStateEnum {
    init(0, "初始化"),
    publish(1, "发布"),
    cancel(2,"取消发布")
    ;

    private Integer code;

    private String desc;

    NewsStateEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static NewsStateEnum getEnumByStatus(Integer status) {
        if (null == status) {
            return null;
        }
        for (NewsStateEnum item : values()) {
            if (item.getCode().equals(status)) {
                return item;
            }
        }
        return null;
    }

}
